<template>
  <div class="hm-search-item">
    <div class="item-title">{{ title }}</div>
    <div class="item-content" v-if="Object.keys(valueList).length">
      <div class="item-list one-txt-cut" v-for="(item, index) in valueList" :key="index" @click="searchItemClick(item)">{{ item.title || item }}</div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    title: {
      type: String,
      default: ''
    },
    valueList: {
      type: Array,
      default () {
        return []
      }
    }
  },

  methods: {
    searchItemClick (target) {
      this.$emit('click', target)
    }
  }
}
</script>

<style lang="scss" scoped>
.hm-search-item {
  margin: 0 20px;
  color: #333;
  .item-title {
    padding: 15px 0;
    font-weight: 700;
    font-size: 14px;
  }
  .item-content {
    display: flex;
    flex-wrap: wrap;
    .item-list {
      width: 50%;
      height: 32px;
      font-size: 13px;
    }
  }
}
</style>
